import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import vitePluginImp from 'vite-plugin-imp';

export default defineConfig({
  plugins: [
    react(),
    vitePluginImp({
      libList: [
        {
          libName: 'antd',
          style: (name) => `antd/es/${name}/style/index`,
        },
      ],
    }),
  ],
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
        modifyVars: {
          '@primary-color': '#1890ff', // 设置主要颜色
          '@layout-header-background': '#ffffff', // 设置其他主题变量
          '@layout-sider-background': '#ffffff', // 设置其他主题变量
        },
      },
    },
  },
  server: {
    host: '0.0.0.0',
    port: 3000,
  },
});

